package com.woniu.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 注册拦截器的类
 *
 * @author WenXin
 * @version 1.0
 * @description: TODO
 * @date 2022/8/26 16:24
 */
@Configuration
public class IntercepterRegister implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册我们的拦截器进入WebMvc,并配置拦截的请求参数 /**拦截所有请求
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**");
    }
}
